#include "../include/cmd.h"
#include "../include/stm32mp157_gpio.h"
#include "../include/led.h"
#include "../include/strcmp.h"

cmd_t cmdInfoArray[] = {
    {"led1on",led1_on},
    {"led1off",led1_off},
    {"led2on",led2_on},
    {"led2off",led2_off},
    {"led3on",led3_on},
    {"led3off",led3_off}
};

cmd_t* find_cmd(const char* cmdString)
{
    for(int i=0;i<sizeof(cmdInfoArray)/sizeof(cmd_t);i++)
    {
        if(!(myStrcmp(cmdString,cmdInfoArray[i].m_name)))
            return &cmdInfoArray[i];
    }
    return (cmd_t*)0;
}